using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.CourseTrain.Dtos
{
    /// <summary>
    /// Ilearning响应接口
    /// </summary>
    /// <typeparam name="T">result列席</typeparam>
    public class ILearningResponseDto<T>
    {
        /// <summary>
        /// 时间
        /// </summary>
        [JsonProperty("runtime")]
        public double Runtime { get; set; }

        /// <summary>
        /// 是否成功状态
        /// </summary>
        [JsonProperty("status")]
        public string Status { get; set; }

        /// <summary>
        /// 错误编码
        /// </summary>
        [JsonProperty("errcode")]
        public int ErrorCode { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [JsonProperty("errmsg")]
        public string ErrorMessage { get; set; }

        /// <summary>
        /// 响应实体
        /// </summary>
        [JsonProperty("results")]
        public T Results { get; set; }

        /// <summary>
        /// 异常信息
        /// </summary>
        [JsonProperty("exception")]
        public ExceptionDetail Exception { get; set; }

        /// <summary>
        /// 查询页码
        /// </summary>
        [JsonProperty(PropertyName = "page")]
        public int Page { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        [JsonProperty(PropertyName = "pageCount")]
        public int PageCount { get; set; }

        /// <summary>
        /// 总数
        /// </summary>
        [JsonProperty(PropertyName = "counts")]
        public int Counts { get; set; }
    }

    /// <summary>
    /// 异常DTO
    /// </summary>
    public class ExceptionDetail
    {
        /// <summary>
        /// 异常名称
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// 异常消息
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [JsonProperty("code")]
        public int Code { get; set; }

        /// <summary>
        /// 异常编码
        /// </summary>
        [JsonProperty("status")]
        public int Status { get; set; }
    }
}
